setupWindow

fun setupWindow(child: Window, position: Int)
fun setupWindow(child: Window, parent: Component?)
fun setupWindow(child: Window, x: Int, y: Int)
fun setupWindow(child: Window, width: Int, height: Int, position: Int)
fun setupWindow(child: Window, width: Int, height: Int, parent: Component?)


fun setupWindow(child: Window, width: Int, height: Int, x: Int, y: Int, parent: Component? = null)

Set up the given window at the given size and location or centered on the given parent, if provided. This will ensure that the window is centered on the parent, the display with the given coordinates, or the default/main display if none of those apply. It will also ensure that the window is not shown off-screen and not too large to fit on the selected display.

Parameters

child

the window to size and place appropriately

width

the width of the window, or zero to use the window's preferredSize.width

height

the height of the window, or zero to use the windows preferredSize.height

x

the x coordinate for the window or zero to use a sensible positioning algorithm

y

the y coordinate for the window or zero to use a sensible positioning algorithm

parent

the parent component which is used to position the child window sensibly